package it.yuzuojian.com.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import javax.websocket.Session;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

@Configuration
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
    @Bean
    public ObjectMapper objectMapper(){
        return new ObjectMapper();
    }
    @Bean
    public ConcurrentHashMap<String, Session> consumerList(){
        return new ConcurrentHashMap<String, Session>();
    }
    @Bean
    public ConcurrentHashMap<String,List<Session>> serviceMap(){
        return new ConcurrentHashMap<String, List<Session>>();
    }
    @Bean
    public ConcurrentHashMap<String,Session> serviceList(){
        return new ConcurrentHashMap<String,Session>();
    }
}

